﻿using System;
using System.Web.UI;
using Portal.Core;
using Portal.Data.Config;
using Portal.Data.Entity;
using Portal.Data.Webparts;

public partial class Webparts_Templates_truyen_PagingAuthor : WebpartControl
{
    public override WebpartConfig NewConfig
    {
        get { return new ContentPagingConfig(); }
    }

    public ContentPagingConfig PartConfig
    {
        get { return (ContentPagingConfig)Config; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var pageindex = Common.GetCurrentPageIndex();
            var books = Author.Search(Request["key"], pageindex);
            Items.DataSource = books;
            Items.DataBind();
            Common.PagingWithouTotalCount(new Control[] { phPagingBottom }, pageindex, books.Count, BaseObject.PageSize50);
        }
    }
}